import cv2
import numpy as np

img1 = cv2.imread('4/map1.png')
img2 = cv2.imread('4/map2.png')
img2 = cv2.resize(img2, (1739, 1422))

b, g, r = cv2.split(img1)
b[b>220] = 255
b[b<220] = 0

b = cv2.bitwise_not(b)
b = cv2.merge([b, b, b])

map_merge = cv2.add(img2, b)
cv2.imshow('b', b)
cv2.imshow('img2', img2)
cv2.imshow('map_merge', map_merge)

cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.imwrite('map_merge.jpg', map_merge)


